{% extends 'base.html' %}
{% block title %}添加模块{% endblock %}
{% block content %}
<div class="h4" style="margin-top: 20px">
    <form action="" method="post" class="form-inline">
        {% csrf_token %}
        <div class="form-group">
            <label>模块：</label>
            <input type="text" class="form-control" name="module">
        </div>
        <div class="form-group">
            <label>参数：</label>
            <input type="text" class="form-control" name="args">
        </div>
        <div class="form-group">
            <input class="btn btn-primary" type="submit" value="提 交">
        </div>
    </form>
</div>
<hr>
<div class="h4">
    <table class="table table-striped table-hover">
        <tr class="info">
            <td>模块</td>
            <td>参数</td>
        </tr>
        {% for module in modules %}
            <tr>
                <td>{{ module.modulename }}</td>
                <td>
                    <ul class="list-unstyled">
                        {% for arg in module.argument_set.all %}
                            <li>
                                <div class="col-sm-10">
                                    {{ arg.arg_text }}
                                </div>
                                <div class="col-sm-2">
                                    <a href="{% url 'delarg' arg_id=arg.id %}">
                                        删除
                                    </a>
                                </div>
                            </li>
                        {% endfor %}
                    </ul>
                </td>
            </tr>
        {% endfor %}
    </table>
</div>
{% endblock %}